package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class ZongbuController {
    @Autowired
    com.example.demo.dao.ZongbuDao bookDao;

    @PostMapping("/del_book")
    public int del_book(@RequestBody Map map){
        return bookDao.del_book(map);
    }
    @PostMapping("/add_book")
    public int add_book(@RequestBody Map map){
        return bookDao.add_book(map);
    }
    @PostMapping("/find_all_book")
    public List<Map> find_all_book(@RequestBody Map map) throws InterruptedException {
        return bookDao.find_all_book(map);
    }
}
